Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combine socket #34

Closed
wants to merge 10 commits into from
Closed

Combine socket #34

wants to merge 10 commits into from

Conversation

sproctor
Copy link
Contributor

@sproctor sproctor commented Jul 9, 2024

No description provided.

sproctor added 7 commits July 8, 2024 18:14
# Conflicts:
#	demo/src/main/java/com/ivanempire/lighthouse/demo/MainActivity.kt
#	lighthouse/src/commonMain/kotlin/com/ivanempire/lighthouse/core/DiscoveryManager.kt
#	lighthouse/src/commonMain/kotlin/com/ivanempire/lighthouse/core/RealDiscoveryManager.kt
#	lighthouse/src/main/java/com/ivanempire/lighthouse/LighthouseClient.kt
emit(discoveryDatagram)
}
}
.catch { cause ->
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should have broken this into multiple commits, sorry.

This is a bit tricky to notify with flows. If the connection gets closed, we should handle it gracefully. Also, it would be nice to notify the user. Perhaps the top level data passed to the user should include a connection state.

val datagramPacketRequest = searchRequest.toDatagramPacket(multicastGroup)

repeat(retryCount + 1) {
if (!multicastSocket.isClosed) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to fix a crash I experienced. Not sure why the socket wasn't open, but there are apparently times when it's not.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am guessing you've seen this on desktop? Or did you observe this on Android?

@ivanempire
Copy link
Owner

Closing for now since we're both async on this work - feel free to reopen :)

@ivanempire ivanempire closed this Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants